<%--
  Created by IntelliJ IDEA.
  User: 26056
  Date: 2021/4/30
  Time: 15:13
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>

  <head>
    <title>login</title>
  </head>

  <body>

  <script>
    window.onload = function(){
      document.getElementById("img").onclick = function(){
        this.src="/CheckCode?time="+new Date().getTime();
      }
    }
  </script>

  <h2>登陆界面</h2>

  <form action="/login" method="post">
    <table>
      <tr>
        <td>邮箱</td>
        <td><input type="text" name="useremail"></td>
      </tr>
      <tr>
        <td>密码</td>
        <td><input type="password" name="password"></td>
      </tr>
      <tr>
        <td>验证码</td>
        <td><input type="text" name="checkCode"></td>
      </tr>
      <tr>
        <td colspan="2"><img id="img" src="/CheckCode"></td>
      </tr>
      <tr>
        <td colspan="2"><input type="submit" value="登录"></td>
      </tr>
    </table>
    </form>

  <form action="/login/register.jsp" method="post">
    <input type="submit" value="如果没有账户，请注册">
  </form>

  <form action="/login/user.jsp" method="post">
      <input type="submit" value="返回">
  </form>

  <div><%=request.getAttribute("cc_error") == null ? "" : request.getAttribute("cc_error")%></div>
  <div><%=request.getAttribute("login_error") == null ? "" : request.getAttribute("login_error") %></div>
  <div><%=request.getAttribute("user") == null ? "" : "你好，用户："+request.getAttribute("user") %></div>

  </body>

</html>
